
#pragma once

#include "Event.h"
#include "EventListener.h"
#include <list>
#include <map>
using std::multimap;
using std::pair;
using std::list;


class EventSystem
{
public:
	static EventSystem* GetInstance(void);
	void Register(string eventType, EventListener* listener);
	void Unregister(string eventType, EventListener* listener);
	void SendEvent(string eventType, void* data = nullptr, void* target = nullptr, void* source = nullptr);
	void Update(void);
	void Shutdown(void);

private:
	EventSystem() {}
	~EventSystem() {}
	multimap<string,EventListener*> listeners;
	list<Event> events;
	EventSystem(const EventSystem&);
	EventSystem& operator=(const EventSystem&);
};
